package holiday_demo.pc;

public class Main {
    public static void main(String[] args) {
        //首先创建一个计算机
        Computer computer = new Computer();
        computer.powerOn();

        //准备一个鼠标，供电脑使用
        //Mouse usbMouse=new Mouse();
        //向上转型
        USB usbMouse = new Mouse();//多态写法
        computer.usbDevice(usbMouse);
        //准备一个键盘类
        KeyBoard keyBoard = new KeyBoard();
        computer.usbDevice(keyBoard);


        computer.powerOff();
    }
}
